package com.childenglish.validation;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * 密码匹配验证注解
 * 用于验证两个密码字段是否一致
 */
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = PasswordMatchValidator.class)
@Documented
public @interface PasswordMatch {
    String message() default "两次密码输入不一致";
    
    Class<?>[] groups() default {};
    
    Class<? extends Payload>[] payload() default {};
    
    /**
     * 密码字段名，默认为 "password"
     */
    String password() default "password";
    
    /**
     * 确认密码字段名，默认为 "confirmPassword"
     */
    String confirmPassword() default "confirmPassword";
}

